<template>
  <div class="reportFormPage">
    <!--    <topOperation/>-->
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">土烧失量、有机质、酸碱度、易溶盐总量试验检测记录表</div>
        <div class="codeText">
          <tr>JGLQ01014</tr>
          <tr>JGLQ01015</tr>
          <tr>JGLQ01016</tr>
          <tr>JGLQ01017</tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span class="placeholder">{{ form.jilbh }}</span>
        </div>
      </div>
      <div class="table-border">
        <!-- .........................1111111111111111111111111111111......................................................... -->
        <table height="220px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="50" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ 'placeholder': !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>

                <span>；样品数量：</span>
                <span :class="{ 'placeholder': !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ 'placeholder': !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ 'placeholder': !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%;">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%;">{{ form.shiytjsd }}</span>%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" class="height100"
                  style="width: 15%" />℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" class="height100"
                  style="width: 15%" />%RH
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark"
                  @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView"
                  @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="30" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark"
                  @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <table height="580px" class="middle-table">
          <tbody>
            <tr trindex="0">
              <td colspan="10">烧失量试验</td>
            </tr>
            <tr trindex="1">
              <td colspan="1" class="td1" rowspan="2">
                试验
                <br />次数
              </td>
              <td colspan="1" class="td1" rowspan="2">
                灼烧温度
                <br />（℃）
              </td>
              <td colspan="1" class="td1" rowspan="2">
                土样质量
                <br />（g）
              </td>
              <td colspan="3" class="td3" rowspan="1">灼烧残渣+坩埚质量m₂（g）</td>
              <td colspan="1" class="td1" rowspan="2">
                空坩埚质量
                <br />（g）
              </td>
              <td colspan="1" class="td1" rowspan="2">
                烧失量
                <br />（%）
              </td>
              <td colspan="2" class="td2" rowspan="2">
                平均烧失量
                <br />（%）
              </td>
            </tr>
            <tr trindex="2">
              <td colspan="1" class="td1" rowspan="1">第1次称量</td>
              <td colspan="1" class="td1" rowspan="1">第2次称量</td>
              <td colspan="1" class="td1" rowspan="1">第3次称量</td>
            </tr>
            <tr trindex="3">
              <td colspan="1" class="td1" rowspan="1">1</td>
              <td colspan="1" class="td1" rowspan="2">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.zhuoswd"
                  @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'" />
              </td>

              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl1" @blur="calculateShaosl('1')"
                  @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'" />
              </td>
              <td colspan=" 1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di1ccl1"
                  @keydown.native="handleKeyDown($event, 0, 2)" :ref="'0_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di2ccl1"
                  @keydown.native="handleKeyDown($event, 0, 3)" :ref="'0_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di3ccl1" @blur="calculateShaosl('1')"
                  @keydown.native="handleKeyDown($event, 0, 4)" :ref="'0_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.kongggzl1" @blur="calculateShaosl('1')"
                  @keydown.native="handleKeyDown($event, 0, 5)" :ref="'0_5'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shaosl1" disabled />
              </td>

              <td colspan="2" class="td2" rowspan="2">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.pingjsll" disabled />
              </td>
            </tr>
            <tr trindex="4">
              <td colspan="1" class="td1" rowspan="1">2</td>

              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl2" @blur="calculateShaosl('2')"
                  @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di1ccl2"
                  @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di2ccl2"
                  @keydown.native="handleKeyDown($event, 1, 2)" :ref="'1_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.di3ccl2" @blur="calculateShaosl('2')"
                  @keydown.native="handleKeyDown($event, 1, 3)" :ref="'1_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.kongggzl2" @blur="calculateShaosl('2')"
                  @keydown.native="handleKeyDown($event, 1, 4)" :ref="'1_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shaosl2" disabled />
              </td>
            </tr>

            <tr trindex="5">
              <td colspan="10">有机质含量试验</td>
            </tr>
            <tr trindex="6">
              <td colspan="1" class="td1" rowspan="4">
                硫酸亚
                <br />铁溶液
                <br />标定
              </td>
              <td colspan="1" class="td1" rowspan="1">标定次数</td>
              <td colspan="1" class="td1" rowspan="1">
                K2Cr2O7溶
                <br />液浓度（mol/L）
              </td>
              <td colspan="1" class="td1" rowspan="1">
                K2Cr2O7溶
                <br />液的消耗量（mL）
              </td>
              <td colspan="2" class="td2" rowspan="1">
                硫酸亚铁溶液的消耗
                <br />量（mL）
              </td>
              <td colspan="2" class="td2" rowspan="1">
                硫酸亚铁标准溶液
                <br />的浓度（mol/L）
              </td>
              <td colspan="2" class="td2" rowspan="1">
                硫酸亚铁标准溶液的
                <br />标准浓度（mol/L）
              </td>
            </tr>
            <tr trindex="7">
              <td colspan="1" class="td1" rowspan="1">1</td>
              <td colspan="1" class="td1" rowspan="3">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.k2cr207rynd"
                  @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.k2cr207rydxhl1"
                  @keydown.native="handleKeyDown($event, 2, 1)" :ref="'2_1'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytrydxhl1"
                  @keydown.native="handleKeyDown($event, 2, 2)" :ref="'2_2'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytbzrydnd1"
                  @keydown.native="handleKeyDown($event, 2, 3)" :ref="'2_3'" />
              </td>
              <td colspan="2" class="td2" rowspan="3">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytbzrydbznd"
                  @keydown.native="handleKeyDown($event, 2, 4)" :ref="'2_4'" />
              </td>
            </tr>
            <tr trindex="8">
              <td colspan="1" class="td1" rowspan="1">2</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.k2cr207rydxhl2"
                  @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytrydxhl2"
                  @keydown.native="handleKeyDown($event, 3, 1)" :ref="'3_1'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytbzrydnd2"
                  @keydown.native="handleKeyDown($event, 3, 2)" :ref="'3_2'" />
              </td>
            </tr>
            <tr trindex="9">
              <td colspan="1" class="td1" rowspan="1">3</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.k2cr207rydxhl3"
                  @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytrydxhl3"
                  @keydown.native="handleKeyDown($event, 4, 1)" :ref="'4_1'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.liusytbzrydnd3"
                  @keydown.native="handleKeyDown($event, 4, 2)" :ref="'4_2'" />
              </td>
            </tr>

            <tr trindex="10">
              <td colspan="1" class="td1" rowspan="2">
                试验
                <br />次数
              </td>
              <td colspan="1" class="td1" rowspan="2">
                土样质量
                <br />（g）
              </td>
              <td colspan="3" class="td3" rowspan="1">
                空白标定消耗硫酸亚铁标准溶
                <br />液的量V'（mL）
              </td>
              <td colspan="3" class="td3" rowspan="1">
                滴定土样消耗硫酸亚铁标准溶
                <br />液的量V（mL）
              </td>
              <td colspan="1" class="td1" rowspan="2">
                有机质含
                <br />量（%）
              </td>
              <td colspan="1" class="td1" rowspan="2">
                平均有机
                <br />质含量（%）
              </td>
            </tr>
            <tr trindex="11">
              <td colspan="1" class="td1" rowspan="1">
                滴定前
                <br />读数
              </td>
              <td colspan="1" class="td1" rowspan="1">
                滴定后
                <br />读数
              </td>
              <td colspan="1" class="td1" rowspan="1">
                滴定
                <br />消耗
              </td>
              <td colspan="1" class="td1" rowspan="1">
                滴定前
                <br />读数
              </td>
              <td colspan="1" class="td1" rowspan="1">
                滴定后
                <br />读数
              </td>
              <td colspan="1" class="td1" rowspan="1">
                滴定
                <br />消耗
              </td>
            </tr>
            <tr trindex="12">
              <td colspan="1" class="td1" rowspan="1">1</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl1Yjz"
                  @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didqds1Kb"
                  @keydown.native="handleKeyDown($event, 5, 1)" :ref="'5_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didhds1Kb"
                  @keydown.native="handleKeyDown($event, 5, 2)" :ref="'5_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didxh1Kb"
                  @keydown.native="handleKeyDown($event, 5, 3)" :ref="'5_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didqds1Dd"
                  @keydown.native="handleKeyDown($event, 5, 4)" :ref="'5_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didhds1Dd"
                  @keydown.native="handleKeyDown($event, 5, 5)" :ref="'5_5'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didxh1Dd"
                  @keydown.native="handleKeyDown($event, 5, 6)" :ref="'5_6'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.youjzhl1" @blur="calculatePingjyjzhl"
                  @keydown.native="handleKeyDown($event, 5, 7)" :ref="'5_7'" />
              </td>
              <td colspan="1" class="td1" rowspan="2">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.pingjyjzhl" disabled />
              </td>
            </tr>
            <tr trindex="13">
              <td colspan="1" class="td1" rowspan="1">2</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl2Yjz"
                  @keydown.native="handleKeyDown($event, 6, 0)" :ref="'6_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didqds2Kb"
                  @keydown.native="handleKeyDown($event, 6, 1)" :ref="'6_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didhds2Kb"
                  @keydown.native="handleKeyDown($event, 6, 2)" :ref="'6_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didxh2Kb"
                  @keydown.native="handleKeyDown($event, 6, 3)" :ref="'6_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didqds2Dd"
                  @keydown.native="handleKeyDown($event, 6, 4)" :ref="'6_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didhds2Dd"
                  @keydown.native="handleKeyDown($event, 6, 5)" :ref="'6_5'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.didxh2Dd"
                  @keydown.native="handleKeyDown($event, 6, 6)" :ref="'6_6'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.youjzhl2" @blur="calculatePingjyjzhl"
                  @keydown.native="handleKeyDown($event, 6, 7)" :ref="'6_7'" />
              </td>
            </tr>

            <tr trindex="14">
              <td colspan="10">酸碱度试验</td>
            </tr>
            <tr trindex="15">
              <td colspan="1" class="td1" rowspan="1">
                试验
                <br />次数
              </td>
              <td colspan="1" class="td1" rowspan="1">
                土样质量
                <br />（g）
              </td>
              <td colspan="1" class="td1" rowspan="1">
                水的体积
                <br />（mL）
              </td>
              <td colspan="1" class="td1" rowspan="1">土水比</td>
              <td colspan="2" class="td2" rowspan="1">土悬液温度（℃）</td>
              <td colspan="2" class="td2" rowspan="1">土悬液pH值</td>
              <td colspan="2" class="td2" rowspan="1">土悬液平均pH值</td>
            </tr>
            <tr trindex="16">
              <td colspan="1" class="td1" rowspan="1">1</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl1Sjd"
                  @keydown.native="handleKeyDown($event, 7, 0)" :ref="'7_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shuidtj1"
                  @keydown.native="handleKeyDown($event, 7, 1)" :ref="'7_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tusb1"
                  @keydown.native="handleKeyDown($event, 7, 2)" :ref="'7_2'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuxywd1"
                  @keydown.native="handleKeyDown($event, 7, 3)" :ref="'7_3'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuxyphz1"
                  @keydown.native="handleKeyDown($event, 7, 4)" :ref="'7_4'" />
              </td>
              <td colspan="2" class="td2" rowspan="2">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuxypjphz"
                  @keydown.native="handleKeyDown($event, 7, 5)" :ref="'7_5'" />
              </td>
            </tr>
            <tr trindex="17">
              <td colspan="1" class="td1" rowspan="1">2</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuyzl2Sjd"
                  @keydown.native="handleKeyDown($event, 8, 0)" :ref="'8_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shuidtj2"
                  @keydown.native="handleKeyDown($event, 8, 1)" :ref="'8_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tusb2"
                  @keydown.native="handleKeyDown($event, 8, 2)" :ref="'8_2'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuxywd2"
                  @keydown.native="handleKeyDown($event, 8, 3)" :ref="'8_3'" />
              </td>
              <td colspan="2" class="td2" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.tuxyphz2"
                  @keydown.native="handleKeyDown($event, 8, 4)" :ref="'8_4'" />
              </td>
            </tr>

            <tr trindex="18">
              <td colspan="10">易溶盐总量试验</td>
            </tr>
            <tr trindex="19">
              <td colspan="1" class="td1" rowspan="2">
                试验
                <br />次数
              </td>
              <td colspan="1" class="td1" rowspan="2">
                吸取浸出液
                <br />体积V(mL)
              </td>
              <td colspan="1" class="td1" rowspan="2">
                干土样质
                <br />量ms（g）
              </td>
              <td colspan="2" class="td2" rowspan="1">蒸发皿的质量m₁(g)</td>
              <td colspan="2" class="td2" rowspan="1">
                蒸发皿+残渣的质量
                <br />m₂(g)
              </td>
              <td colspan="1" class="td1" rowspan="2">
                残渣质量
                <br />m(g)
              </td>
              <td colspan="1" class="td1" rowspan="2">
                全盐量
                <br />（%）
              </td>
              <td colspan="1" class="td1" rowspan="2">
                全盐量平均值
                <br />(%)
              </td>
            </tr>
            <tr trindex="19">
              <td colspan="1" class="td1" rowspan="1">第1次称量</td>
              <td colspan="1" class="td1" rowspan="1">第2次称量</td>
              <td colspan="1" class="td1" rowspan="1">第1次称量</td>
              <td colspan="1" class="td1" rowspan="1">第2次称量</td>
            </tr>
            <tr trindex="20">
              <td colspan="1" class="td1" rowspan="1">1</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.xiqqcytj1"
                  @keydown.native="handleKeyDown($event, 9, 0)" :ref="'9_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.gantyzl1"
                  @keydown.native="handleKeyDown($event, 9, 1)" :ref="'9_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.diyccl1Zfmdzl"
                  @keydown.native="handleKeyDown($event, 9, 2)" :ref="'9_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.dieccl1Zfmdzl"
                  @keydown.native="handleKeyDown($event, 9, 3)" :ref="'9_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.diyccl1Zfmjczdzl"
                  @keydown.native="handleKeyDown($event, 9, 4)" :ref="'9_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.dieccl1Zfmjczdzl"
                  @keydown.native="handleKeyDown($event, 9, 5)" :ref="'9_5'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.canzzl1"
                  @keydown.native="handleKeyDown($event, 9, 6)" :ref="'9_6'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.quanyl1"
                  @keydown.native="handleKeyDown($event, 9, 7)" :ref="'9_7'" />
              </td>
              <td colspan="1" class="td1" rowspan="2">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.quanylpjz"
                  @keydown.native="handleKeyDown($event, 9, 8)" :ref="'9_8'" />
              </td>
            </tr>
            <tr trindex="21">
              <td colspan="1" class="td1" rowspan="1">2</td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.xiqqcytj2"
                  @keydown.native="handleKeyDown($event, 10, 0)" :ref="'10_0'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.gantyzl2"
                  @keydown.native="handleKeyDown($event, 10, 1)" :ref="'10_1'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.diyccl2Zfmdzl"
                  @keydown.native="handleKeyDown($event, 10, 2)" :ref="'10_2'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.dieccl2Zfmdzl"
                  @keydown.native="handleKeyDown($event, 10, 3)" :ref="'10_3'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.diyccl2Zfmjczdzl"
                  @keydown.native="handleKeyDown($event, 10, 4)" :ref="'10_4'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.dieccl2Zfmjczdzl"
                  @keydown.native="handleKeyDown($event, 10, 5)" :ref="'10_5'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.canzzl2"
                  @keydown.native="handleKeyDown($event, 10, 6)" :ref="'10_6'" />
              </td>
              <td colspan="1" class="td1" rowspan="1">
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.quanyl2"
                  @keydown.native="handleKeyDown($event, 10, 7)" :ref="'10_7'" />
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import { handleFocus, emptyConvert, handleKeyDown } from "@/views/reportForms/utils";
import { getTgTdsslyjzjlbBsInfo } from "@/api/report_tg/tgTdsslyjzjlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";
import Bus from "@/utils/bus";
import decimal from "@/utils/big-decimal";
export default {
  name: "tdsslyjzjlb",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data () {
    return {
      // 表单参数
      form: {}
    };
  },
  watch: {
    isPdf (newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created () {
    // console.log("this.excelId: ", this.excelId);
    this.getInfo();
  },
  methods: {
    // 获取详情
    getInfo () {
      getTgTdsslyjzjlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示检测依据列表
    showBsJiancyjView () {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj (info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setTgBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView () {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge (info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView () {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument (info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setTgBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },
    // 计算烧失量
    calculateShaosl (type) {
      if (!this.form["tuyzl" + type] || !this.form["kongggzl" + type] || !this.form["di3ccl" + type]) {
        this.form["shaosl" + type] = "";
        this.calculatePingjsll();
        return;
      }
      // 烧失量 = （土样质量 + 空坩埚质量 - 第3次称量）* 100 / 土样质量
      const sum = decimal.subtract(decimal.add(this.form["tuyzl" + type], this.form["kongggzl" + type]), this.form["di3ccl" + type]);
      this.form["shaosl" + type] = decimal.divide(decimal.multiply(sum, 100), this.form["tuyzl" + type]);
      this.calculatePingjsll();
    },
    // 计算平均烧失量
    calculatePingjsll () {
      if (!this.form["shaosl1"] || !this.form["shaosl2"]) {
        this.form["pingjsll"] = "";
        return;
      }
      this.form["pingjsll"] = decimal.divide(decimal.add(this.form["shaosl1"], this.form["shaosl2"]), 2);
      Bus.$emit("setTgBgJiancjg", [{ key: 18, value: this.form.pingjsll }]);
    },
    // 计算平均有机质含量
    calculatePingjyjzhl () {
      if (!this.form["youjzhl1"] || !this.form["youjzhl2"]) {
        this.form["pingjyjzhl"] = "";
        return;
      }
      this.form["pingjyjzhl"] = decimal.divide(decimal.add(this.form["youjzhl1"], this.form["youjzhl2"]), 2);
      Bus.$emit("setTgBgJiancjg", [{ key: 17, value: this.form.pingjyjzhl }]);
    },
    submitForm () {
      return this.form;
    },
    handleFocus (event) {
      handleFocus(event, this.page, this.form[event]);
    },
    handleKeyDown (event, rowIndex, colIndex) {
      const maxArr = [5, 4, 4, 2, 2, 7, 7, 5, 4, 8, 7]; // 每一行最多有多少可聚焦输入框（从0开始）
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped>
.td1 {
  width: calc(100% / 10 * 1);
}

.td2 {
  width: calc(100% / 10 * 2);
}

.td3 {
  width: calc(100% / 10 * 3);
}

.td4 {
  width: calc(100% / 10 * 4);
}

.td5 {
  width: calc(100% / 10 * 5);
}
</style>
